Simple Imperative Polymorphism

نویسنده

  • Andrew K. Wright
چکیده

This paper describes a simple extension of the Hindley-Milner polymorphic type discipline to call-by-value languages that incorporate imperative features like references, exceptions, and continuations. This extension sacrifices the ability to type every purely functional expression that is typable in the Hindley-Milner system. In return, it assigns the same type to functional and imperative implementations of the same abstraction. Hence with a module system that separates specifications from implementations, imperative features can be freely used to implement polymorphic specifications. A study of a number of ML programs shows that the inability to type all Hindley-Milner typable expressions seldom impacts realistic programs. Furthermore, most programs that are rendered untypable by the new system can be easily repaired.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Typing References by Eeect Inference European Symposium on Programming

Hindley/Milner-style polymorphism is a simple, natural, and exible type discipline for functional languages, but incorporating imperative extensions is dii-cult. We present a new technique for typing references in the presence of polymor-phism by inferring a concise summary of each expression's allocation behavior|a type eeect. A simple technique for proving soundness with respect to a reductio...

متن کامل

HMC: Verifying Functional Programs Using Abstract Interpreters

Refinement Types are a promising approach for checking behavioral properties of programs written using advanced language features like higher-order functions, parametric polymorphism and recursive datatypes. The main limitation of refinement type systems to date is the requirement that the programmer provides the types of all functions, after which the type system can check the types and hence,...

متن کامل

Semantics of Parametric Polymorphism in Imperative Programming Languages

Programming languages such as CLU, Ada and Modula-3 have included facilities for parametric polymorphism and, more recently, C++ and Java have also added similar facilities. In this paper, we examine the issues of defining denotational semantics for imperative programming languages with polymorphism. We use the framework of reflexive graphs of categories previously developed for a general axiom...

متن کامل

Trusted Source Translation of a Total Function Language

We present a trusted source translator that transforms total functions defined in the specification language of the HOL theorem prover to simple intermediate code. This translator eliminates polymorphism by code specification, removes higher-order functions through closure conversion, interprets pattern matching as conditional expressions, etc. The target intermediate language can be further tr...

متن کامل

Realisability semantics of parametric polymorphism, general references and recursive types

We present a realisability model for a call-by-value, higher-order programming language with parametric polymorphism, general first-class references, and recursive types. The main novelty is a relational interpretation of open types that include general reference types. The interpretation uses a new approach to modelling references. The universe of semantic types consists of world-indexed famil...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Lisp and Symbolic Computation

دوره 8  شماره 

صفحات  -

تاریخ انتشار 1995